<?php
	$cur_page_ver="1.0d";
	//echo $cur_page_ver;
	$this_page="index";
	$this_title="Home";
	require_once('includes/global.php');
	$result=$dbcon->query(SQL_get_latest_news,2,page_location=='local'?'devforums':'stimpy_forums');
	$x=0;
	if(is_array($result[0]))
	{
		foreach($result as $row)
		{
			$news[$x]['header']=$row[0];
			$news[$x]['time']=date("F j, Y @ g:i:s A T",(int)$row[1]);
			$news[$x]['article']=preg_replace('/[\n]/',' ',$row[2]);
			$news[$x]['article']=preg_replace('/\[list[:0-9a-f]*\]/','<ul>',$news[$x]['article']);
			$news[$x]['article']=preg_replace('/\[\/list[:0-9a-fu]*\]/','</ul>',$news[$x]['article']);
			$news[$x]['article']=preg_replace('/\[\*[:0-9a-f]*\]/','<li>',$news[$x]['article']);
			$x++;
		}
	}
	else
	{
		$news[$x]['header']=$result[0];
		$news[$x]['time']=date("F j, Y @ g:i:s A T",(int)$result[1]);
		$news[$x]['article']=preg_replace('/[\n]/',' ',$result[2]);
		$news[$x]['article']=preg_replace('/\[list[:0-9a-f]*\]/','<ul>',$news[$x]['article']);
		$news[$x]['article']=preg_replace('/\[\/list[:0-9a-fu]*\]/','</ul>',$news[$x]['article']);
		$news[$x]['article']=preg_replace('/\[\*[:0-9a-f]*\]/','<li>',$news[$x]['article']);
	}
	$smarty->assign('news',$news);
//	$if
	$smarty->display('header.tpl');
	$smarty->display('index.tpl');
	$smarty->display('footer.tpl');
?>